<?php 
class menu
{
	public function init($user, $stat)
	{
		if($stat=='siswa')
		{
			$this->siswa($user, $stat);
		}
		else
		{
			$this->guru($user, $stat);
		}
	}

	public function guru($user, $stat)
	{
		$simpan2=mysql_query("SELECT * FROM  $stat where email = '$user'");
		$hasil2=mysql_fetch_array($simpan2);

		echo'
		
			
		<ul class="sidebar-nav"  id="side-menu" style="margin-top:17px;padding-bottom:10px;" >
				<li>
				<a class="story-img" data-toggle="modal" href="#profile"><img src="'.$hasil2["img"].'" style="width:100px;height:100px" class="img-circle">'.$hasil2["first_name"].' '.$hasil2["last_name"].'</a>
				<a href=""></a>
				</li>
				<li>
				<a href="#"style="border-style:dashed;"><strong>DASHBOARD</strong><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li>
                        <a href="posting.php" >Posting</a>
                    </li>
                    <li>
                        <a href="listpost.php" >List Posting</a>
                    </li>
                </ul>
				</li>
		
				<li class="active">
				<a style="border-style:dashed;"><strong>SEARCH</strong><span class="fa arrow"></span></a>
				<ul class="nav nav-second-level ">
				<form action="search.php" method="post" class="form-inline">
								<br>
								<div class="form-group">
								<select size="1" name="kelas" id="kelas" class="form-control" onchange=ambildata(this.value) required />
								<option selected>--Pilih Kelas--</option>';
								
								include "pilihan.php";
								
								echo '</select>
								</div>	
								<br>
								<br>
								<div class="form-group">
								<select size="1" name="mapel" id="mapel" class="form-control" onchange=ambilguru(this.value) required />
								<option selected>--Pilih MApel--</option>
								
								</select>
									
								</div>
								<br>
								<br>
								<div class="form-group">
									
								<select size="1" name="guru" id="guru" class="form-control" required />
								<option selected>--Pilih Guru--</option>
								
								</select>
								</div>
								<br>
								<br>
								<div class="form-group">
								<button class="btn btn-success">CARI</button>
								</div>
								</form>
				</ul>	
				</li>
				</ul>';
				

	}
	public function siswa($user, $stat)
	{
		$simpan2=mysql_query("SELECT * FROM  $stat where email_sis = '$user'");
		$hasil2=mysql_fetch_array($simpan2);
		echo '<ul class="sidebar-nav"  id="side-menu" style="margin-top:17px;padding-bottom:10px;" >
				<li>
				<a class="story-img" data-toggle="modal" href="#profile"><img src="'.$hasil2["img"].'" style="width:100px;height:100px" class="img-circle">'.$hasil2["first_name"].' '.$hasil2["last_name"].'</a>
				<a href=""></a>
				</li>
				
				<li class="active">
				<a style="border-style:dashed;"><strong>SEARCH</strong><span class="fa arrow"></span></a>
				<ul class="nav nav-second-level ">
				<form action="search.php" method="post" class="form-inline">
								<br>
								<div class="form-group">
								<select size="1" name="kelas" id="kelas" class="form-control" onchange=ambildata(this.value) required />
								<option selected>--Pilih Kelas--</option>';
								
								include "pilihan.php";
								
								echo '</select>
								</div>	
								<br>
								<br>
								<div class="form-group">
								<select size="1" name="mapel" id="mapel" class="form-control" onchange=ambilguru(this.value) required />
								<option selected>--Pilih MApel--</option>
								
								</select>
									
								</div>
								<br>
								<br>
								<div class="form-group">
									
								<select size="1" name="guru" id="guru" class="form-control" required />
								<option selected>--Pilih Guru--</option>
								
								</select>
								</div>
								<br>
								<br>
								<div class="form-group">
								<button class="btn btn-success">CARI</button>
								</div>
								</form>
				</ul>	
				</li>
				</ul>';

	}

}
?>